import * as api from "./api";

export default {
  // 获取配置数据
  getConfigs: isDisLoading => {
    return api.get(`/api/common/configs`, "", { isDisLoading });
  },

  // 获取国家编号
  getCountryList: () => {
    return api.get(`/api/login/country`);
  },
  getTypeConfigs: type => {
    return api.get(`/api/common/configs/${type}`);
  },

  // 获取验证码
  getLoginCode: params => {
    return api.get(`/api/login/verification-code`, params);
  },

  // 校验验证码
  verifyLoginCode: params => {
    return api.get(`/api/login/verification-code-valid`, params);
  },

  // 账号登陆-注册
  loginAction: params => {
    return api.post(`/api/login`, params);
  },

  // 平台切换
  switchPlatform: params => {
    return api.put(`/api/users/platform-switch`, params);
  },

  // 用户中心-用户信息
  getUsersMsg: () => {
    return api.get(`/api/users/center`);
  },

  // 获取协议链接
  getPlatformId: (platformId) => {
    return api.get(`/api/common/agreements?platformId=${platformId}`);
  },

  
  // 注销账号
  deleteAccount: () => {
    return api.del(`/api/users`)
  },
};
